<?php 
	$q=$_GET["id"];
	if (strlen($q) > 0)
   	{
   		$dbhandle= new PDO('sqlite:./datos/galeria.sqlite');
		$dbhandle->exec("UPDATE Pinturas SET Likes=Likes+1 WHERE Id=".$q);
		
		$result= $dbhandle->query("SELECT Likes FROM Pinturas WHERE Id=".$q);

		$row = $result->fetch();	
		echo $row[0];
		$dbhandle = NULL;
 	}
?>   